package com.second.system.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.second.common.pojo.Role;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created by wang1 on 2023/5/22 19:18
 */
public interface RoleDao extends BaseMapper<Role> {
    @Select(value = "select r.* from acl_role r join acl_user_role ur on r.id=ur.role_id where ur.user_id=#{userId}")
    List<Role> selectByUserId(String userId);

    @Delete(value = "delete from acl_user_role where user_id=#{userId}")
    void deleteByUserId(String userId);
}
